import QtQuick 2.0
import QtWebView 1.1
import HBaiduLogin 1.0

Rectangle {
    BaiduLogin {
        id:cpp_lg
    }
    WebView {
        id:webview
        anchors.fill: parent
        url: "https://openapi.baidu.com/oauth/2.0/authorize?response_type=token&client_id=iqPkre9wXIMqwbXlezC1uIGzFBGdHsHl&redirect_uri=oob&scope=basic,netdisk&login_type=sms"
        onLoadingChanged: function(loadRequest) {
            if (loadRequest.errorString)
                console.error(loadRequest.errorString);
            //console.log("test", webview.url);
            if(cpp_lg.loginSucess(webview.url)){
            }else{
                console.log("false");
            }
        }
    }
}



